<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>接口文档</title>
    <link rel="stylesheet" href="./bootstrap.css">
    <script src="./jquery-3.1.1.js"></script>
</head>
<body>
    <div class="docbox" style="width:80%;margin:30px auto;">
            <ul class="nav nav-pills">
                <li role="presentation" v-for="(item,key,index) in doc" :data-is="index" :key="index" v-bind:class="{'activce':who==key}" @click="whofn(key)"><a href="#">{{key}}</a></li>
            </ul>
            <div class="api">
                <h3 class="">{{doc[who].name}}</h3>
                <div v-for="(item,index) in doc[who].li" :key="index">
                    <hr/>
                    <h4>{{index+1}}.{{item.loader}}&nbsp;&nbsp;&nbsp;请求类型：{{item.type}} &nbsp;&nbsp;&nbsp;&nbsp; 请求路径：{{item.url}}</h4>
                    <div v-if="item.req"> 
                            <h5>请求参数</h5>
                            <table class="table table-striped">
                                <tr>
                                    <th>name</th>
                                    <th>val</th>
                                </tr>
                                <tr v-for="(reqitem,reqindex) in item.req" :key="reqindex">
                                    <th>{{reqitem.name}}</th>
                                    <th>{{reqitem.val}}</th>
                                </tr>
                            </table>
                    </div>
                    <div v-if="item.res.li.length>0">
                            <h5>返回参数</h5>
                            <table class="table table-striped">
                                <tr>
                                    <th>name</th>
                                    <th>val</th>
                                </tr>
                                <tr v-for="(reqitem,reqindex) in item.res.li" :key="reqindex">
                                    <th>{{reqitem.name}}</th>
                                    <th>{{reqitem.val}}</th>
                                </tr>
                            </table>
                    </div>
                    
                    <div v-if="item.res.child.length>0">
                            <h5>rows返回数组参数</h5>
                            <table class="table table-striped">
                                <tr>
                                    <th>name</th>
                                    <th>val</th>
                                </tr>
                                <tr v-for="(reqitem,reqindex) in item.res.child" :key="reqindex">
                                    <th>{{reqitem.name}}</th>
                                    <th>{{reqitem.val}}</th>
                                </tr>
                            </table>
                    </div>
                </div>
                
            </div>
    </div>
    <script src="./vue.min.js"></script>
    <script>
        
        var vm = new Vue({
            el:'.docbox',
            data:{
                who:'前端接口',
                isadmin:'admin',
                doc:{
                		 "前端接口":{
                            "name":"前端banner获取",
                            "li":[
                                {
                                    "loader":"banner获取",
                                    "url":"/api/banner",
                                    "type":"post",
                                    "req":[
                                        {"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"IsDisplay","val":"是否展示"},
                                            {"name":"IsIndex","val":"是否首页展示"}
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"首页新闻列表获取",
                                    "url":"/api/newsindex",
                                    "type":"post",
                                    "req":[
                                        {"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"},
                                        {name:'FrId',val:'1:新闻动态，2:人才培养，3:产业发展，4：产教融合，5:安全科普，6:会议报名,...'}
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"展示下拉全部的列表",
                                    "url":"/api/addlist",
                                    "type":"post",
                                    "req":[
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"展示下拉二级页面的单个列表",
                                    "url":"/api/addlist",
                                    "type":"post",
                                    "req":[
                                    {name:'ftype',val:'0-7'}
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"查看二级页面新闻列表",
                                    "url":"/api/newslist",
                                    "type":"post",
                                    "req":[
                                        {"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"},
                                        {name:'FrId',val:'1:新闻动态，2:人才培养，3:产业发展，4：产教融合，5:安全科普，6:会议报名,...'}
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"产看新闻详情",
                                    "url":"/api/detail",
                                    "type":"post",
                                    "req":[
                                        {name:'id',val:'id'}
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"搜索内容",
                                    "url":"/api/search",
                                    "type":"post",
                                    "req":[
                                    {"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"},
                                        {name:'Title',val:'搜索标题'}
                                    ],
                                    "res":{
                                        "li":[
                                           
                                        ],
                                        "child":[]
                                    }
                                }
                            ]
                        },
                        "用户":{
                            "name":"用户登录",
                            "li":[
                                {
                                    "loader":"登录接口",
                                    "url":"/admin/login",
                                    "type":"post",
                                    "req":[],
                                    "res":{
                                        "li":[{"name":"ret","val":"true/false"}],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"用户注销",
                                    "url":"/admin/layout",
                                    "type":"post",
                                    "req":[],
                                    "res":{
                                        "li":[],
                                        "child":[]
                                    }
                                },{
                                	"loader":"用户是否登陆",
                                    "url":"/admin/islogin",
                                    "type":"post",
                                    "req":[],
                                    "res":{
                                        "li":[{"name":"ret","val":"true/false"}],
                                        "child":[]
                                    }
                                }
                            ]
                        },
                        "banner":{
                            "name":"banner接口管理",
                            "li":[
                                {
                                    "loader":"banner添加",
                                    "url":"/admin/banner/addlist",
                                    "type":"post",
                                    "req":[
                                    {"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"IsDisplay","val":"是否展示"},
                                            {"name":"IsIndex","val":"是否首页展示"}],
                                    "res":{
                                        "li":[{"name":"ret","val":"true/false"}],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"banner修改",
                                    "url":"/admin/banner/update",
                                    "type":"post",
                                    "req":[
                                        {"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"IsDisplay","val":"是否展示"},
                                            {"name":"IsIndex","val":"是否首页展示"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[]
                                    }
                                },
                                {
                                    "loader":"获取banner",
                                    "url":"/admin/banner/show",
                                    "type":"post",
                                    "req":[
                                        {"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"total","val":"20"},
                                            {"name":"rows","val":"child"}
                                        ],
                                        "child":[
                                            {"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"IsDisplay","val":"是否展示"},
                                            {"name":"IsIndex","val":"是否首页展示"}
                                        ]
                                    }
                                },{
                                    "loader":"banner获取详情",
                                    "url":"/admin/banner/edit",
                                    "type":"post",
                                    "req":[
                                    {"name":"id","val":"id"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"IsDisplay","val":"是否展示"},
                                            {"name":"IsIndex","val":"是否首页展示"}
                                        ],
                                        "child":[]
                                    }
                                },{
                                    "loader":"banner删除",
                                    "url":"/admin/banner/del",
                                    "type":"post",
                                    "req":[
                                    {"name":"id","val":"id"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[]
                                    }
                                }
                            ]
                        },
                        "二级或三级类":{
                        	"name":"添加二级或三级类",
                        	"li":[
                        		{
                        			loader:"添加二级或三级类",
                        			"url":"/admin/addlist/addlist",
                        			"type":"post",
                        			"req":[
                        				{"name":"id","val":"id"},
                        				{"name":"Name","val":"名称"},
                        				{"name":"Type","val":"2/3"},
                        				{"name":"FrId","val":"0-7/id"},
                        				{"name":"CreateTime","val":"time"},
                        				{"name":"IsIndex","val":"是否首页展示"},
                        				{"name":"IsDisplay","val":"是否展示"},
                        				{"name":"Sort","val":"排序"}
                        			],
                        			"res":{
                        				"li":[],
                        				child:[]
                        			}
                        		},
                        		{
                        			loader:"修改二级或三级类",
                        			"url":"/admin/addlist/update",
                        			"type":"post",
                        			"req":[
                        				{"name":"id","val":"id"},
                        				{"name":"Name","val":"名称"},
                        				{"name":"Type","val":"2/3"},
                        				{"name":"FrId","val":"0-7/id"},
                        				{"name":"CreateTime","val":"time"},
                        				{"name":"IsIndex","val":"是否首页展示"},
                        				{"name":"IsDisplay","val":"是否展示"},
                        				{"name":"Sort","val":"排序"}
                        			],
                        			"res":{
                        				"li":[],
                        				child:[]
                        			}
                        		},
                        		{
                        			loader:"查看二级或三级类",
                        			"url":"/admin/addlist/show",
                        			"type":"post",
                        			"req":[{name:"ftype",val:"0-7/不传为输出全部"}],
                        			"res":{
                        				"li":[
                        					{name:'ret',val:'true/false'},
                        					{name:'data',val:'rows'}
                        				],
                        				child:[
                        					{"name":"展示","val":"根据层级"},
                        				]
                        			}
                        		},
                        		{
                        			loader:"删除",
                        			"url":"/admin/addlist/del",
                        			"type":"post",
                        			"req":[
                                    {"name":"id","val":"id"}
                                    ],
                                    "res":{
                                        "li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]
                                    }
                        		}
                        	]
                        },
                        "新闻":{
                            "name":"新闻接口管理",
                            "li":[
                                {
                                    "loader":"新闻添加",
                                    "url":"/admin/news/addlist",
                                    "type":"post",
                                    "req":[
                                    	{"name":"id","val":"id"},
                                            {"name":"Title","val":"标题"},
                                            {"name":"Sumary","val":"简介"},
                                            {"name":"Source","val":"来源"},
                                            {"name":"Link","val":"链接"},
                                            {"name":"UpdataTime","val":"选定上传时间"},
                                            {"name":"Content","val":"内容"},
                                            {"name":"Picture","val":"图片"},
                                            {"name":"Sort","val":"排序"},
                                            {"name":"Type","val":"类型"},
                                            {"name":"IsDisplay","val":"0/1"},
                                            {"name":"IsIndex","val":"0/1"},
                                            {"name":"FrId","val":"属于哪个父级"},
                                            {"name":"CreateTime","val":"创建时间"}
                                    ],
                                    "res":{
                                    	"li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]
                                    }
                                },
                                {
                                    "loader":"新闻列表",
                                    "url":"/admin/news/show",
                                    "type":"post",
                                    "req":[{"name":"offset","val":"0"},
                                        {"name":"limit","val":"10"}],
                                    "res":{
                                        "li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]
                                    }
                                },
                                {
                                    "loader":"新闻修改",
                                    "url":"/admin/news/update",
                                    "type":"post",
                                    "req":[],
                                    "res":{
                                        "li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]
                                    }
                                },
                                {
                                    "loader":"新闻获取详情",
                                    "url":"/admin/news/edit",
                                    "type":"post",
                                    "req":[{"name":"id","val":"id"}],
                                    "res":{"li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]}
                                },
                                {
                                    "loader":"新闻删除",
                                    "url":"/admin/news/del",
                                    "type":"post",
                                    "req":[{"name":"id","val":"id"}],
                                    "res":{"li":[
                                            {"name":"ret","val":"true/false"}
                                        ],
                                        "child":[

                                        ]}
                                }
                            ]
                        }
                }
            },
            mounted() {
                
            },
            methods:{
                whofn(val){
                    this.who = val;
                }
            }
        })
    </script>
    
</body>
</html>